package com.sptpc.qimoxiangmu.model.vo;

import com.sptpc.qimoxiangmu.util.OrderState;
import com.sptpc.qimoxiangmu.util.OrderState;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import org.hibernate.annotations.Type;
import org.joda.money.Money;

import javax.persistence.*;
import java.io.Serializable;
import java.time.LocalDateTime;

@Entity
@Table(name = "view_order_detail")
@IdClass(OrderKey.class)
@Getter
@AllArgsConstructor
@NoArgsConstructor
public class OrderDetailVo implements Serializable {
    @Id
    private Long orderId;
    private String customer;
    @Enumerated
    @Column(nullable = false)
    private OrderState orderState;
    @Id
    private Long modelId;
    private String modelName;
    @Type(type = "org.jadira.usertype.moneyandcurrency.joda.PersistentMoneyMinorAmount",
            parameters = {@org.hibernate.annotations.Parameter(name = "currencyCode", value = "CNY")}
    )
    private Money modelPrice;
    private Long typeId;
    private String typeName;
    private LocalDateTime createTime;
    private LocalDateTime updateTime;
}
